home *** CD-ROM | disk | FTP | other *** search
-
- window.doc
-
- Version: 1.31
- Author: kat
- Create: 11/10/89
- Update: 04/02/90
-
-
- Window management OOP style
-
-
-
-
- window Interface Documentation
-
- Summary
-
- A window object is created by a wdw_open with handle returned. All
- subsequent operations must use the handle to distinquish among windows.
- The wdw_init* functions set the object descriptor values, such as dimension,
- border style, attributes, etc. wdw_put makes the window appear on the screen,
- while wdw_remove removes it. wdw_close destroys the window object.
-
- Pop-up prompts and pop-up menus utilize windows.
-
- Library includes video/keyboard functions which are independent from
- windows. These functions are not prefixed by wdw_.
-
-
- List of Functions
-
- Window
-
- int wdw_init ( int, int, int);
- void wdw_init_style( int, int, int, int);
- void wdw_init_position( int, int, int);
- void wdw_put ( int );
- void wdw_remove ( int );
- void wdw_clear ( int );
- void wdw_fill ( int, char);
- void wdw_scroll_down ( int, char *);
- void wdw_scroll_up ( int, char *);
- void wdw_display ( int, int, int, char *, char);
- int wdw_open()
- void wdw_close( int )
- int wdw_start()
- void wdw_end()
-
- Video/keyboard
-
- void video_init();
- int mono();
- void display ( int, int, char *, char);
- void cursor_off();
- void cursor_on();
- void clear_screen();
- void clear_line (int);
- void keyboard_flush();
- int pop_up_prompt( int, int, int, char, char, char, char *, char *);
- int prompt ( int, int, int, char, char, char *, char *);
- int pop_up_menu ( int, int, char, char, char, char *, char *);
-
-
-
- Notes
-
-
-
- /* Use the following reference pattern for each interface function */
-
-
- --------------------------------------------------------------------------
- wdw_
- --------------------------------------------------------------------------
-
- Function .
-
- Syntax
-
- Arguments
-
-
-
- Remarks
-
-
- Return value
-
- Limitations
-
- See also
-
- Example
-
-
- --------------------------------------------------------------------------
- wdw_init
- --------------------------------------------------------------------------
-
- Function Initialize window size.
-
- Syntax int wdw_init(int handle, int no_of_rows, int no_of_cols)
-
- Arguments handle - object handle
- no_of_rows - dimension > 2
- no_of_cols - dimension > 2
-
-
- Remarks Must be the next call after open to set window dimension
- and allocate memory for overlap and current content.
-
-
- Return value true - memory for window buffers allocated ok
- false - failed to allocate memory
-
- Limitations Dimension must be greater than 2 because border takes
- up 2 lines.
-
- See also wdw_init_style, wdw_init_position
-
- Example if ( wdw_init ( rolodex, Rolodex_rows, Rolodex_cols) )
- begin_if
- ...
- ...
- end_if
-
-
- --------------------------------------------------------------------------
- wdw_init_style
- --------------------------------------------------------------------------
-
- Function Initilize style parameters.
-
- Syntax void wdw_init_style( int handle, int style,
- int border_attr, int background);
-
- Arguments handle
- style - No_border, Solid_border, Single_border,
- Double_border
- border_attr - attribute for border
- background - attribute for background
-
- Remarks Sets window object parameters.
-
-
- Return value
-
- Limitations
-
- See also wdw_init, wdw_init_position
-
- Example wdw_init_style ( rolodex, Double_border, Red, Blue);
-
-
- --------------------------------------------------------------------------
- wdw_init_position
- --------------------------------------------------------------------------
-
- Function Set screen display position of window.
-
- Syntax void wdw_init_position( int handle, int display_row,
- int display_col);
-
- Arguments handle
- display_row - upper left corner row 0 - 24
- display_col - upper left corner column 0 - 79
-
-
-
- Remarks
-
-
- Return value
-
- Limitations Window must fit with border on screen.
-
- See also wdw_init, wdw_init_style
-
- Example wdw_init_position ( rolodex, Rolodex_row_pos, Rolodex_col_pos);
-
-
-
- --------------------------------------------------------------------------
- mono()
- --------------------------------------------------------------------------
-
- Function Test if monitor is monochromatic.
-
- Syntax int mono();
-
- Arguments
-
-
-
- Remarks
-
-
- Return value true - monchromatic
- false - color
-
- Limitations
-
- See also
-
- Example
- if ( mono () )
- attribute = White On Black;
- else
- attribute = Yellow On Blue;
-
-
-
- --------------------------------------------------------------------------
- keyboard_flush()
- --------------------------------------------------------------------------
-
- Function Flush keyboard of waiting key characters.
-
- Syntax void keyboard_flush()
-
- Arguments
-
-
-
- Remarks
-
-
- Return value
-
- Limitations
-
- See also
-
- Example keyboard_flush();
-
-
-
- --------------------------------------------------------------------------
- video_init
- --------------------------------------------------------------------------
-
- Function Video initialization - not related to window object.
-
- Syntax void video_init()
-
- Arguments
-
-
-
- Remarks Checks if monitor is mono or color. Sets defaults.
- Called from wdw_start when windowing is used.
- If display() is used without windowing, then
- video_init must be called prior to any video functions.
-
-
- Return value
-
- Limitations
-
- See also display
-
- Example video_init();
-
-
- --------------------------------------------------------------------------
- wdw_put
- --------------------------------------------------------------------------
-
- Function Makes window visible on the screen.
-
- Syntax void wdw_put( int handle)
-
- Arguments handle
-
-
-
- Remarks A window object becomes visible by this function.
- It saves overlap area before displaying window.
-
-
- Return value
-
- Limitations
-
- See also wdw_remove
-
- Example wdw_put( rolodex);
-
-
- --------------------------------------------------------------------------
- wdw_remove
- --------------------------------------------------------------------------
-
- Function Removes window from the screen.
-
- Syntax void wdw_remove ( int handle);
-
- Arguments handle
-
-
-
- Remarks Restores overlap area, thus making window disappear.
-
-
- Return value
-
- Limitations
-
- See also wdw_put
-
- Example wdw_remove( rolodex );
-
-
- --------------------------------------------------------------------------
- wdw_clear
- --------------------------------------------------------------------------
-
- Function Clears window.
-
- Syntax void wdw_clear ( int handle);
-
- Arguments handle
-
-
-
- Remarks
-
-
- Return value
-
- Limitations
-
- See also
-
- Example wdw_clear( rolodex );
-
-
- --------------------------------------------------------------------------
- wdw_fill
- --------------------------------------------------------------------------
-
- Function Fills window with a selected character.
-
- Syntax wdw_fill ( int handle, char fill_char)
-
- Arguments handle
- fill_char - fill character
-
-
-
- Remarks
-
-
- Return value
-
- Limitations
-
- See also
-
- Example wdw_fill ( rolodex, Under_bar );
-
-
-
- --------------------------------------------------------------------------
- wdw_scroll_down
- --------------------------------------------------------------------------
-
- Function Scroll down window one line, display new top line.
-
- Syntax void wdw_scroll_up( int handle, char *new_line)
-
- Arguments handle - window handle
- new_line - top line text
-
-
-
- Remarks Window is scrolled down one line. Bottom line disappears.
- Top line is cleared. New top text is displayed.
-
-
- Return value
-
- Limitations
-
- See also wdw_scroll_up
-
- Example wdw_scroll_down( Telephone_window, Name_telephone);
-
-
-
- --------------------------------------------------------------------------
- wdw_scroll_up
- --------------------------------------------------------------------------
-
- Function Scroll up window one line, display new bottom line.
-
- Syntax void wdw_scroll_up( int handle, char *new_line)
-
- Arguments handle - window handle
- new_line - bottom line text
-
-
-
- Remarks Window is scrolled up one line. Top line disappears.
- Bottom line is cleared. New bottom text is displayed.
-
-
- Return value
-
- Limitations
-
- See also wdw_scroll_down
-
- Example wdw_scroll_up( Telephone_window, Name_telephone);
-
-
-
- --------------------------------------------------------------------------
- wdw_display
- --------------------------------------------------------------------------
-
- Function Display text in window.
-
- Syntax void wdw_display ( int handle, int row, int col,
- char *text, char attribute);
-
- Arguments handle
- row - 1 is first row
- col - 1 is first column
- text
- attribute
-
-
- Remarks
-
-
- Return value
-
- Limitations
-
- See also
-
- Example wdw_display ( rolodex, Title_row, Title_col, Title_text, Blue);
-
-
-
- --------------------------------------------------------------------------
- display
- --------------------------------------------------------------------------
-
- Function Displays text on screen - no relation to window objects.
-
- Syntax void display ( int row, int col, char *text, char attr)
-
- Arguments row - row 0 - 24
- col - column 0 - 79
- text
- attr - attribute
-
- Remarks
-
-
- Return value
-
- Limitations
-
- See also
-
- Example display ( Warning_row, Warning_col, Warning_text, Red);
-
-
- --------------------------------------------------------------------------
- clear_screen
- --------------------------------------------------------------------------
-
- Function Erases screen completely.
-
- Syntax void clear_screen()
-
- Arguments
-
-
-
- Remarks
-
-
- Return value
-
- Limitations
-
- See also
-
- Example clear_screen();
-
-
- --------------------------------------------------------------------------
- clear_line
- --------------------------------------------------------------------------
-
- Function Erases line completely.
-
- Syntax void clear_line(int row)
-
- Arguments row - line to be cleared 1 to 25
-
-
-
- Remarks
-
-
- Return value
-
- Limitations
-
- See also
-
- Example clear_line( Error_row );
-
-
- --------------------------------------------------------------------------
- cursor_off
- --------------------------------------------------------------------------
-
- Function Turns cursor off.
-
- Syntax void cursor_off()
-
- Arguments
-
-
-
- Remarks Cursor will not be seen until it is turned on.
-
-
- Return value
-
- Limitations
-
- See also cursor_on
-
- Example cursor_off();
-
-
- --------------------------------------------------------------------------
- cursor_on
- --------------------------------------------------------------------------
-
- Function Turns cursor on.
-
- Syntax void cursor_on()
-
- Arguments
-
-
-
- Remarks
-
-
- Return value
-
- Limitations
-
- See also cursor_off
-
- Example cursor_on();
-
-
-
- --------------------------------------------------------------------------
- wdw_open
- --------------------------------------------------------------------------
-
- Function Creates an object.
-
- Syntax int wdw_open()
-
- Arguments
-
-
-
- Remarks If creation succesful, memory is allocated for object,
- and a handle is returned.
-
-
- Return value >=0 ok, handle is returned
- eof failed to create object
- Limitations
-
- See also wdw_close
-
- Example if ( ( handle = wdw_open() ) == eof )
- ret = false;
-
-
- --------------------------------------------------------------------------
- wdw_close
- --------------------------------------------------------------------------
-
- Function Destroys object.
-
- Syntax void wdw_close ( int handle)
-
- Arguments handle - handle of object to be destroyed
-
-
-
- Remarks Deallocates memory, releases handle.
-
-
- Return value
-
- Limitations
-
- See also wdw_open
-
- Example wdw_close( stack_handle );
-
-
-
-
- --------------------------------------------------------------------------
- wdw_start
- --------------------------------------------------------------------------
-
- Function Allocates memory for module structure.
-
- Syntax int wdw_start()
-
- Arguments
-
-
-
- Remarks Should be called at the beginning of the program.
-
-
-
- Return value true: allocation is ok, module can be used
- false: failure to allocate, module is not active
-
- Limitations
-
- See also wdw_end
-
- Example if ( not wdw_start() )
- ret = eof;
-
-
- --------------------------------------------------------------------------
- wdw_end
- --------------------------------------------------------------------------
-
- Function Deallocates memory of module structure.
-
- Syntax void wdw_end()
-
- Arguments
-
-
- Remarks Should be called at the end of the program.
-
-
- Return value
-
- Limitations
-
- See also wdw_start
-
- Example wdw_end();
-
-
- --------------------------------------------------------------------------
- pop_up_prompt
- --------------------------------------------------------------------------
-
- Function Prompts for key entry in a one line window.
-
- Syntax int prop_up_prompt( int row, int col, int length,
- char message_attr, char input_attr,
- char *message, char *dest)
-
- Arguments row - window upper left corner row
- col - ditto column
- length - maximum input length
- message_attr - prompt attribute
- input_attr - input attribute
- messagge - prompt text
- dest - keyed string output pointer
-
-
-
- Remarks Self-sufficient input prompt. It opens its own window.
- Screen is restored after entry.
-
-
- Return value true - entry
- false - no entry
-
- Limitations
-
- See also prompt
-
- Example pop_up_prompt( Entry_row, Entry_col, Address_length, Green,
- Yellow, Address_prompt, address);
-
-
- --------------------------------------------------------------------------
- prompt
- --------------------------------------------------------------------------
-
- Function Prompts for key entry.
-
- Syntax int prompt( int row, int col, int length,
- char message_attr, char input_attr,
- char *message, char *dest)
-
- Arguments row - prompt row
- col - prompt column
- length - maximum input length
- message_attr - prompt attribute
- input_attr - input attribute
- messagge - prompt text
- dest - keyed string output pointer
-
-
-
- Remarks Prompts for input. It does not clean up after entry.
-
-
- Return value true - entry
- false - no entry
-
- Limitations
-
- See also pop_up_prompt
-
- Example prompt( Entry_row, Entry_col, Address_length, Green,
- Yellow, Address_prompt, address);
-
-
- --------------------------------------------------------------------------
- pop_up_menu
- --------------------------------------------------------------------------
-
- Function Pop up menu with title and choices.
-
- Syntax pop_up_menu( int row, int col, char message_attr,
- char border_attr, char bar_attr,
- char *title, char *choices);
-
- Arguments row - upper left row of window
- col - ditto column
- message_attr - text attribute
- border_attr - border attribute
- bar_attr - menu bar attribute
- title - menu title
- choices - choices separated by "|"
-
- Remarks Cursor keys position bar, enter key selects option.
- It opens its own window and closes it after completion.
-
- Return value 0 - Esc key pressed, no selection
- >0 - selected item sequence number
-
-
- Limitations
-
- See also
-
- Example
-
- #define Main_menu_title "Mailing List"
- #define Main_menu_choices "Review|Change|Add|Delete|Print|Exit"
-
- option = pop_up_menu( Main_menu_row, Main_menu_col,
- Red, Hi_cyan, Black On White,
- Main_menu_title, Main_menu_choices);
-
- End of window Interface Documentation
-
- ----------------end-of-author's-documentation---------------
-
- Software Library Information:
-
- This disk copy provided as a service of
-
- The Public (Software) Library
-
- We are not the authors of this program, nor are we associated
- with the author in any way other than as a distributor of the
- program in accordance with the author's terms of distribution.
-
- Please direct shareware payments and specific questions about
- this program to the author of the program, whose name appears
- elsewhere in this documentation. If you have trouble getting
- in touch with the author, we will do whatever we can to help
- you with your questions. All programs have been tested and do
- run. To report problems, please use the form that is in the
- file PROBLEM.DOC on many of our disks or in other written for-
- mat with screen printouts, if possible. The P(s)L cannot de-
- bug programs over the telephone.
-
- Disks in the P(s)L are updated monthly, so if you did not get
- this disk directly from the P(s)L, you should be aware that
- the files in this set may no longer be the current versions.
-
- For a copy of the latest monthly software library newsletter
- and a list of the 2,000+ disks in the library, call or write
-
- The Public (Software) Library
- P.O.Box 35705 - F
- Houston, TX 77235-5705
- Orders: 800-2424-PSL
- Info: 713-524-6394
- FAX #: 713-524-6398
- CIS ID: 71355,470
-